package org.springframework.samples.mvc.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.samples.mvc.hello.HelloBean;

import com.mkyong.hello.controller.HelloWorldDAO;

@Configuration
public class BeanConfig {
	@Bean 
	//@Qualifier("helloBean1")
	public HelloBean createHelloBean1(){
		return new HelloBean();
	}
	
	@Bean
	public HelloBean helloBean1(){
		return new HelloBean();
	}
	
	@Bean 
	@Lazy
	@Qualifier("helloBean2")
	public HelloBean createHelloBean2(){
		return new HelloBean();
	}
	
	@Bean (name={"helloBean1","helloBean2","helloBean3"})
	public HelloBean helloBeanxxx(){
		return new HelloBean();
	}
	
	@Bean (name={"helloWorldDAO","dao"})
	public HelloWorldDAO helloWorldDAO(){
		return new HelloWorldDAO();
	}
}
